package com.itheima.vms.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.itheima.vms.domain.po.ItemSku;
import com.itheima.vms.domain.po.ItemSpu;
import com.itheima.vms.domain.vo.ItemListVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface ItemMapper extends BaseMapper<ItemSpu> {

    List<ItemListVo> page(String code, String title, String itemCategory);

    void insertSpu(ItemSpu spu);

    void insertSku(ItemSku sku);

    ItemSpu selectSpuById(Long aLong);

    List<ItemSku> selectSkuById(Long id);

    void updateSpu(ItemSpu spu);

    List<ItemSku> selectSkuBySpuId(Long id);

    void updateSku(ItemSku existingSku);

    void deleteSkuById(Long id);

    List<Map<String, Object>> page(Page<Map<String, Object>> page, QueryWrapper<Map<String, Object>> queryWrapper);

}
